﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Uniforax.Core.Common;
using Uniforax.Core.GameActions;
using Uniforax.Core.GameObjects;

namespace Uniforax.Camp.TestData.BigStake
{
    public class UpgradeBigStakeAction : BaseGameAction
    {
        public PosId PosId { get; set; }
        public string ObjectId { get; set; }
        public int OldDamage { get; set; }

        public UpgradeBigStakeAction(BaseGameObject gameObject)
        {
            PosId = gameObject.PosId;
            ObjectId = gameObject.ObjectId;
        }

        public override void Execute(ActionContext context)
        {
            var world = context.GameWorld;
            var grid = world.GetGrid(PosId);
            var bigStake = grid.GetPlacedObject(ObjectId) as BigStake;
            if (bigStake is null) { IsCancenlled = true; return; }

            //OldDamage = bigStake;
        }
    }
}
